﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Theme="SkinFile" Inherits="Nivdal.TranslatedSentences" Title="Translated sentences - nivdal.com!" Codebehind="TranslatedSentences.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" Runat="Server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:HiddenField ID="LanguageHiddenField" runat="server" />
    
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="PageTitleLabel" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_PageNameLabelText %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
    <asp:HyperLink ID="TranslatePageLink" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_TranslatePageLinkText %>"
     SkinID="GreenTitleHyperLink" NavigateUrl="~/Translate.aspx" ></asp:HyperLink>  
     <br /><br /> 
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    
    <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel2" >
        <ProgressTemplate>
            <div class="ajaxloader">
                <asp:Image ID="ProgressImagePanel2" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    
    <asp:GridView ID="TranslatedSentencesGridView" runat="server" AutoGenerateColumns="false" AllowPaging="true"
     SkinID="Professional" DataSourceID="TranslateDataSource" PageSize="100">
        <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
            Mode="NumericFirstLast" PageButtonCount="10" Position="TopAndBottom" />
        <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
        <Columns>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, TranslatedSentences_SentenceNumNumHeaderText %>">
                <ItemTemplate>
                    <asp:Label ID="SentenceNumLabel" runat="server" Text='<%# Eval("SentenceNum") + "." + Eval("SentencePart") %>' SkinID="GridLabel"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:Label ID="SentenceNumLabel" runat="server" Text='<%# Eval("SentenceNum") + "." + Eval("SentencePart") %>' SkinID="GridLabel"></asp:Label>
                </EditItemTemplate>                
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, TranslatedSentences_EnglishTextHeaderText %>">
                <ItemTemplate>
                    <asp:Label ID="EnglishTextLabel" runat="server" Text='<%# Eval("EnglishText") %>' SkinID="GridLabel"></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:Label ID="EnglishTextLabel" runat="server" Text='<%# Eval("EnglishText") %>' SkinID="GridLabel"></asp:Label>    
                </EditItemTemplate>                
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ Resources:Resource, TranslatedSentences_TextHeaderText %>">
                <ItemTemplate>
                    <asp:Label ID="TranslationLabel" runat="server" Text='<%# Eval("SentenceText") %>' SkinID="GridLabel"></asp:Label> 
                </ItemTemplate>
                <EditItemTemplate>
                    <CustomControls:TextArea ID="TranslationTextBox" runat="server" Text='<%# Bind("SentenceText") %>' TextMode="MultiLine"
                     Width="250px" Height="80px" MaxLength="512"></CustomControls:TextArea>
                    <asp:HiddenField ID="SentenceIdHiddenField" runat="server" Value='<%# Bind("SentenceId") %>' />
                    
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="EditLinkButton" runat="server" Text="<%$ Resources:Resource, Global_Edit%>"
                     CommandName="Edit" SkinID="GreenTitleLink"></asp:LinkButton>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:LinkButton ID="UpdateLinkButton" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_UpdateLinkButtonText%>"
                     CommandName="Update" SkinID="GreenTitleLink"></asp:LinkButton>
                    <asp:LinkButton ID="CancelLinkButton" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_CancelLinkButtonText%>"
                     CommandName="Cancel" SkinID="GreenTitleLink"></asp:LinkButton> 
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    </ContentTemplate>
    </asp:UpdatePanel>
    <br /><br />
    <div style="float:left;">
        <asp:Label ID="SkippedSentencesTitleLabel" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_SkippedSentencesTitleLabelText%>"
         SkinID="InfoLabel"></asp:Label>
    </div>
    
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div class="ajaxloader">
                <asp:Image ID="ProgressImagePanel1" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:GridView ID="UnskipGridView" runat="server" DataSourceID="UnskipDataSourse" AutoGenerateColumns="false"
             AllowPaging="false" SkinID="Professional" >
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Label ID="SentenceTextLabel" runat="server" Text='<%# Eval("EnglishText") %>' SkinID="GridLabel"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HiddenField ID="SkipIdHiddenField" runat="server" Value='<%# Bind("SkipId") %>' />
                            <asp:LinkButton ID="UnskipLinkButton" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_UnskipLinkButtonText%>"
                             SkinID="GreenTitleLink" CommandName="Update"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    <br />
                    <asp:Label ID="NoSkippedSentences" runat="server" SkinID="GridLabel"
                    Text="<%$ Resources:Resource, TranslatedSentences_NoSkippedSentencesLabelText%>"></asp:Label>
                </EmptyDataTemplate>
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    
     <asp:SqlDataSource ID="UnskipDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    SelectCommand="Nivdal_GetSkippedSentences" SelectCommandType="StoredProcedure"
    UpdateCommand="Nivdal_UnskipTranslationSentence" UpdateCommandType="StoredProcedure" > 
        <UpdateParameters>
            <asp:Parameter Name="SkipId" Type="Decimal" />
        </UpdateParameters>      
    </asp:SqlDataSource>
    
    <asp:SqlDataSource ID="TranslateDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    SelectCommand="Nivdal_GetTranslatedSentences" SelectCommandType="StoredProcedure"
    UpdateCommand="Nivdal_UpdateSentence" UpdateCommandType="StoredProcedure" >
        <UpdateParameters>
            <asp:Parameter Name="SentenceId" Type="Decimal" />
            <asp:Parameter Name="SentenceText" Type="String"/>   
            <asp:ControlParameter Name="Language" Type="Decimal" ControlID="LanguageHiddenField" PropertyName="Value" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </div>
    </div>    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" Runat="Server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, TranslatedSentences_PageNameLabelText %>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>

